<?php

require_once './include/common.inc.php';
require_once 'left.php';
require_once 'right.php';

$page_title = 'Acuity World WebShop';
$menu_id = 0;
$menu_str = PrintMenu();

$deliver = 0;
$error = 0;

if ($_POST['act'] == "send") {
    $username = $_POST['to'];
    $email = $_POST['temail'];

    $f_name = $_POST['from'];
    //$f_email = $_POST['femail'];
	$msg = $_POST["msg"];

    if (!preg_match("/[a-z0-9\.]{2,}@[a-z0-9]{2,}\.[a-z0-9]+/", $email)) {
        echo "<script>alert('Invalid To Email, Please try again');history.back();</script>";
        exit;
    }

    require_once './mail/tell_friend.php';
    //sendsmtpmail($from_name,$from_email,$to_name,$to_email,$subject,$content);
    sendHideMail($from_name,"",$to_name,$to_email,$subject,$content);
    header("Location:tell_friend.php?succeed");
    exit;    
}

if (isset($_GET['succeed'])) {
    $deliver = 1;
}

require_once PrintEot('header');
require_once PrintEot('left');
require_once PrintEot('tell_friend');
require_once PrintEot('right');
require_once PrintEot('footer');

?>